home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / funitoa.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  713 b   |  31 lines

  1. /*
  2. \funcref{fun\_itoa}{void fun\_itoa ()}
  3.     {}
  4.     {}
  5.     {newvar(), xstrdup()}
  6.     {fun\_atoi(), etc.}
  7.     {funitoa.c}
  8.     {
  9.         This funtion converts the integer variable which was last pushed to a
  10.         string variable. The {\em type} field of the last used stack position
  11.         (this is {\em stack[sp]}) is set to {\em e\_str} and the {\em
  12.         vu.str} field is assigned to hold the string representation of the
  13.         {\em vu.intval} field.
  14.     }
  15. */
  16.  
  17. #include "icm-exec.h"
  18.  
  19. void fun_itoa ()
  20. {
  21.     char
  22.         buffer [100];
  23.     int
  24.         val;
  25.  
  26.     val = stack [sp].vu.intval;
  27.     stack [sp] = newvar (e_str);
  28.     sprintf (buffer, "%d", val);
  29.     stack [sp].vu.i->ls.str = xstrdup (buffer);
  30. }
  31.